library IEEE;
use IEEE.std_logic_1164.all;

entity char2seg7 is
	port (	bin	:	in	character;
		seg7	:	out	std_logic_vector (7 downto 0)
	);
end entity char2seg7;

architecture behavioural of char2seg7 is

begin
	with bin select
		--  --A--           7-segment display         
		-- |     |
		-- F     B          Figure on the left shows
		-- |     |          conventional segment-
		--  --G--           numbering scheme.
		-- |     |          The segments are inverted,
		-- E     C          so a '1' means it's off
		-- |     |          while a '0' means it's on
		--  --D--  .H
		--
		--       HGFEDCBA
  seg7 <=  "01111001" when '!', -- !
           "11011101" when '"', -- "
           "00010010" when '$', -- $
           "11111101" when ''', -- '
           "11111001" when '(', -- (
           "11001111" when ')', -- )
           "01111111" when '*', -- *
           "10001111" when '+', -- +
           "01111111" when ',', -- ,
           "10111111" when '-', -- -
           "01111111" when '.', -- .
           "11101101" when '/', -- /
           "11000000" when '0', -- 0
           "11111001" when '1', -- 1
           "10100100" when '2', -- 2
           "10110000" when '3', -- 3
           "10011001" when '4', -- 4
           "10010010" when '5', -- 5
           "10000010" when '6', -- 6
           "11111000" when '7', -- 7
           "01111111" when '8', -- 8
           "10010000" when '9', -- 9
           "01111101" when ':', -- :
           "01111101" when ';', -- ;
           "10011110" when '<', -- <
           "10100001" when '=', -- =
           "10111100" when '>', -- >
           "00101100" when '?', -- ?
           "00001000" when '@', -- @
           "10001000" when 'A', -- A
           "10000000" when 'B', -- B
           "11000110" when 'C', -- C
           "11000000" when 'D', -- D
           "10000110" when 'E', -- E
           "10001110" when 'F', -- F
           "11000010" when 'G', -- G
           "10001001" when 'H', -- H
           "11111001" when 'I', -- I
           "11110001" when 'J', -- J
           "10001010" when 'K', -- K
           "11000111" when 'L', -- L
           "10101011" when 'M', -- M
           "11001000" when 'N', -- N
           "11000000" when 'O', -- O
           "10001100" when 'P', -- P
           "10011000" when 'Q', -- Q
           "11001100" when 'R', -- R
           "10010010" when 'S', -- S
           "11001110" when 'T', -- T
           "11000001" when 'U', -- U
           "11000001" when 'V', -- V
           "11100010" when 'W', -- W
           "10110110" when 'X', -- X
           "10010001" when 'Y', -- Y
           "11100100" when 'Z', -- Z
           "11000110" when '[', -- [
           "11011011" when '\', -- \
           "11110000" when ']', -- ]
           "11011100" when '^', -- ^
           "11110111" when '_', -- _
           "11011111" when '`', -- `
           "10100000" when 'a', -- a
           "10000011" when 'b', -- b
           "10100111" when 'c', -- c
           "10100001" when 'd', -- d
           "10000110" when 'e', -- e
           "10001110" when 'f', -- f
           "10010000" when 'g', -- g
           "10001011" when 'h', -- h
           "11111011" when 'i', -- i
           "11110001" when 'j', -- j
           "10001010" when 'k', -- k
           "11001111" when 'l', -- l
           "10101011" when 'm', -- m
           "10101011" when 'n', -- n
           "10100011" when 'o', -- o
           "10001100" when 'p', -- p
           "10011000" when 'q', -- q
           "10101111" when 'r', -- r
           "10010010" when 's', -- s
           "10000111" when 't', -- t
           "11100011" when 'u', -- u
           "11100011" when 'v', -- v
           "11100010" when 'w', -- w
           "10110110" when 'x', -- x
           "10010001" when 'y', -- y
           "11100100" when 'z', -- z
           "11000110" when '{', -- {
           "11001111" when '|', -- |
           "11110000" when '}', -- }
           "10111111" when '~', -- ~
        	  "11111111" when others;	-- Weird condition

end architecture behavioural;



